package com.ts.controller;

import com.ts.pojo.Menu;
import com.ts.service.MenuService;
import com.ts.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    /**
     * 查询home页面的左侧菜单
     * 请求方式：Get
     * 路径：/menu/getMuneList
     * 返回值类型：SysResult
     * 需要向前端返回查询到的结果
     */
    @GetMapping("/getMuneList")
    public SysResult getMuneList(){
        List<Menu> list=menuService.getMuneList();
        return SysResult.success(list);
    }
}
